#LinuxServer
to install
go to root on the linux server
apt install sambasystemctl enable smbdsystemctl status smbdnano /etc/samba/smb.confand do the configurations- in our case:
- ![[Pasted image 20240328162709.png]]
creating users and groups
adduser agah- password:
operations smbpasswd -a agahgroupadd partagegpasswd -a agah partage
create the shared folder for everyone to access
mkdir /srv/partagechgrp -R partage /srv/partage/
- chmod -R g+rw /srv/partage to give the read and write rights to the partage shared folder
-
we can see the rights with
ls -al /srv/ -
![[Pasted image 20240328163003.png]]
-
now the file is created on the server.
-
we go to the windows client on the server but we put the network card on the VMnet2 for it to be on the same LAN with the server.
-
we login to the user account and go to windows explorer and go to
\\srvlx01and voilà we see the files ! -
![[Pasted image 20240328163150.png]]
-
to add the shared files to the This PC :
-
we go to the windows client's terminal
-
net use u: \\srvlx01\user -
net use p: \\srvlx01\partage -
and the result is as following :
-
![[Pasted image 20240328163755.png]]
-
if it doesn't work with
srvlx01we can put the IP address of thesrvlx01as well, in our case192.168.3.101, because sometimes it doesn't work on Win11. -
and to overcome this problem we need to activate the NetBIOS on TCP/IP in the IPv4 Advanced Settings as in the image following
-
![[NetBIOS activation.png]]
Editing the user rights
- we go back to the /home/user/smb.conf
- and edit the rights like
- ![[Pasted image 20240328162709.png]]
- L'option "create mask" va permettre de définir les droits par défaut sur les
fichiers (lecture/écriture pour l'utilisateur propriétaire et le groupe propriétaire seulement)
- L'option "directory mask" va permettre de définir les droits par défaut sur
les dossiers
- L'option "force group" va permettre de forcer le groupe "partage" comme
groupe propriétaire des fichiers et dossiers
- at the end we need to restart the service with
systemctl restart smbd - and we need disable SMB1 because it's vulnerable. details are giving in the TP_Samba.